package com.yunshang.shoppingmall.service.impl;

import com.yunshang.shoppingmall.entity.Role;
import com.yunshang.shoppingmall.mapper.RoleMapper;
import com.yunshang.shoppingmall.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("roleService")
public class RoleServiceImpl implements RoleService {

    @Autowired
    RoleMapper roleMapper;

    //删除角色
    @Override
    public int deleteByPrimaryKey(Integer roleId) {
        return roleMapper.deleteByPrimaryKey(roleId);
    }
    //增加权限
    @Override
    public int insert(Role role) {
        return roleMapper.insert(role);
    }

    @Override
    public int insertSelective(Role record) {
        return 0;
    }

    @Override
    public Role selectByPrimaryKey(Integer roleId) {
        return null;
    }

    @Override
    public int updateByPrimaryKeySelective(Role record) {
        return 0;
    }

    @Override
    public int updateByPrimaryKey(Role record) {
        return 0;
    }

    @Override
    public int delByUserId(int userId) {
        return roleMapper.delByUserId(userId);
    }

    @Override
    public List<Role> selectRoleByUserId(int userId) {
        return roleMapper.selectRoleByUserId(userId);
    }

    @Override
    public List<Role> selectList() {
        return roleMapper.selectList();
    }
}
